<template>
  <van-skeleton title avatar :row="3" :loading="loading" v-for="video in videoList">
    <van-card
        :desc="video.introduce"
        :title="video.title"
        :thumb="video.cover"
    >
      <template #footer>
        <van-button size="small" @click="toVideoDetail(video.id)">观看</van-button>
      </template>
    </van-card>
  </van-skeleton>
</template>

<script setup lang="ts">
import {VideoType} from "../model/video";
import {useRouter} from "vue-router";
interface VideoCardListProps{
  videoList:VideoType[];
  loading:true;
}
const props = defineProps<VideoCardListProps>()
const router = useRouter()
const toVideoDetail = (id:number) => {
  router.push({
    path:'/video/videoDetail',
    query:{
      id,
    }
  })
}
</script>

<style scoped>

</style>
